import React, {
	PureComponent
} from 'react';
import './index.less';
import {
	Carousel
} from 'antd-mobile';
import{ bindInviteCode} from '../../services/index';
export default class Home extends PureComponent {
	constructor(props) {
		super(props);

		this.state = {}
	}

	componentDidMount() {
		
	}
	tagertHref(id) {
		console.log('000000000000')
		let str = ''
		if (id === 1) {
			str = '/device/' + id + '/2'
		} else if (id === 2) {
			str = '/operate/' + id + '/2'
		} else if (id === 3) {
			str = '/product/' + id + '/2'
		}

		this.props.history.push(str)
	}
	bindInviteCodeData() {
		bindInviteCode({articleId: 1}).then(response=>{
			console.log(response);
		})
	}

	render() {
		return ( 
			<div className = 'index' > { /* 公告 */ } 
				<div className = "notice ell"><i/>
					根据国家规定， 平台禁止售卖香烟等不合法商品， 一经发现将进行封号处理。 谢谢理解与支持！ 
				</div> { /* 昵称 */ } 
				<div className = "header" >
					<div className = "header-top rowSpaceBetween" >
					<div className = "name" > PPSCM 金博士</div> 
					<div className = "setting" > 设置 </div> 
				</div> { /* 汇总 */ } 
				<Carousel cellSpacing = {16} className = "summary">
			<div className = "items first">
			<dl>
			<dt>今日销售额</dt>
			<dd> 249.42 </dd>
			</dl> 
			<dl>
			<dt>今日预估利润</dt>
			<dd>124.24</dd>
			</dl>
			<dl>
			<dt> 昨日销售额 </dt>
			<dd> 555.22 </dd>
			</dl>
			<dl>
			<dt> 本月销售额 </dt>
			<dd> 2313.23 </dd>
			</dl>
			</div>
			<div className = "items second" >
			<dl className = "guzhang" >
			<dt > 机器故障 </dt>
			<dd>< strong > 0 </strong>台</dd >
			</dl>
			<dl className = "yichang" >
			<dt> 网络异常 </dt>
			<dd> < strong > 1 </strong>台</dd >
			</dl>
			<dl className = "jingbao" >
			<dt > 钱币警报 </dt>
			<dd> < strong > 0 </strong>台</dd >
			</dl>
			<dl className = "buhuo" >
			<dt> 建议补货 </dt>
			<dd><strong > 1 </strong>台</dd >
			<
			/dl> <
			/div> <
			/Carousel> <
			/div> { /* 快捷通道 */ } <
			div className = "quickLink" >
			<
			div className = "item"
			onClick = {
				this.tagertHref.bind(this, 1)
			} >
			<
			i className = "device" / >
			<
			div className = "name" > 设备 < /div> <
			/div> <
			div className = "item"
			onClick = {
				this.tagertHref.bind(this, 2)
			} >
			<
			i className = "yunying" / >
			<
			div className = "name" > 运营 < /div> <
			/div> <
			div className = "item" 
				onClick={ this.tagertHref.bind(this,3)}
			>
			<
			i className = "product" / >
			<div className = "name" > 商品 < /div> <
			/div>
			<div 
				className = "item" 
			>
			<i className = "order"/>
			<div className = "name" > 订单 < /div> <
			/div> <
			div className = "item" >
			<
			i className = "caiwu" / >
			<
			div className = "name" > 财务 < /div> <
			/div> <
			div className = "item" >
			<
			i className = "data" / >
			<
			div className = "name" > 数据 < /div> <
			/div> <
			div className = "item" >
			<
			i className = "group" / >
			<
			div className = "name" > 组织 < /div> <
			/div> <
			div className = "item" >
			<
			i className = "buhuo" / >
			<
			div className = "name" > 补货 < /div> <
			/div> <
			div className = "item" >
			<
			i className = "status" / >
			<
			div className = "name" > 设备状况 < /div> <
			/div> <
			div className = "item" >
			<
			i className = "gongdan" / >
			<
			div className = "name" > 工单处理 < /div> <
			/div> <
			/div> <
			/div>
		)
	}
}
